package com.bg.print.utils;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.util.UriComponents;
import org.springframework.web.util.UriComponentsBuilder;
@Slf4j
public class URLUtils {
    public static String getPath(String url){
        UriComponents build = UriComponentsBuilder.fromHttpUrl(url).build();
        return build.getPath();
    }
    public static String addPath(String url,String urlIp){
        log.debug("urlIp:"+urlIp);
        log.debug("url:"+url);
        UriComponents build = UriComponentsBuilder.fromHttpUrl(urlIp).path(url).build();
        return build.toUriString();
    }
}
